<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>支付设置</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
  {include file="public/css"/}
</head>
<body>
  <div class="layui-fluid">
    <div class="layui-row layui-col-space15">
      <div class="layui-card layui-col-md12">
				<div class="layui-card-header"><i class="fa fa-cog"></i> 支付设置</div>
				<div class="layui-card-body" pad15>
					<div class="layui-form form-label-w6" lay-filter="">
						<div class="layui-form-item">
							<label class="layui-form-label">微支付状态：</label>
							<div class="layui-input-inline">
								<input type="radio" name="info[wxpay]" title="开启" value="1" {if $info['wxpay']==1}checked{/if}/>
								<input type="radio" name="info[wxpay]" title="关闭" value="0" {if $info['wxpay']==0}checked{/if}/>
							</div>
							<div class="layui-form-mid">JSAPI支付授权目录：<b>{$Think.const.PRE_URL2}/</b></div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label">微支付模式：</label>
							<div class="layui-input-inline" style="width:500px">
								<input type="radio" name="info[wxpay_type]" title="普通模式" value="0" {if $info['wxpay_type']==0}checked{/if} lay-filter="diandaSwitchMulti"/>
								<input type="radio" name="info[wxpay_type]" title="服务商模式" value="1" {if $info['wxpay_type']==1}checked{/if} lay-filter="diandaSwitchMulti"/>
								<input type="radio" name="info[wxpay_type]" title="随行付" value="3" {if $info['wxpay_type']==3}checked{/if} lay-filter="diandaSwitchMulti"/>
								{if getcustom('pay_huifu')}
								<input type="radio" name="info[wxpay_type]" title="汇付天下斗拱" value="4" {if $info['wxpay_type']==4}checked{/if} lay-filter="diandaSwitchMulti"/>
								{/if}
								{if getcustom('pay_allinpay')}
								<input type="radio" name="info[wxpay_type]" title="通联支付" value="6" {if $info['wxpay_type']==6}checked{/if} lay-filter="diandaSwitchMulti"/>
								{/if}
								{if getcustom('pay_qilinshuzi')}
								<input type="radio" name="info[wxpay_type]" title="麒麟数字" value="10" {if $info['wxpay_type']==10}checked{/if} lay-filter="diandaSwitchMulti"/>
								{/if}
							</div>
						</div>
						<div class="layui-form-item" diandaSwitchMulti="info[wxpay_type]" data-val="1" {if $info['wxpay_type']!=1}style="display:none"{/if}>
							<label class="layui-form-label">支付商户号：</label>
							<div class="layui-input-inline">
								<input type="text" name="info[wxpay_sub_mchid]" value="{$info['wxpay_sub_mchid']}" class="layui-input"/>
							</div>
							<div class="layui-form-mid layui-word-aux">必须填子商户的商户号</div>
						</div>
						<div diandaSwitchMulti="info[wxpay_type]" data-val="3" {if $info['wxpay_type']!=3}style="display:none"{/if}>
							<div class="layui-form-item">
								<label class="layui-form-label">商户编号：</label>
								<div class="layui-input-inline">
									<input type="text" name="info[sxpay_mno]" value="{$info['sxpay_mno']}" class="layui-input"/>
								</div>
								{if $incomeStatus['income'] || $incomeStatus['incomeLog']}
								<div class="layui-form-mid layui-word-aux"> <a href="javascript:void(0)" onclick="openmax('{:url('SxpayIncome/index')}&isopen=1')">点击申请入驻</a></div>
								{/if}
							</div>
							<div class="layui-form-item">
								<label class="layui-form-label">支付密钥：</label>
								<div class="layui-input-inline" style="width:280px">
									<input type="text" name="info[sxpay_mchkey]" value="{$info['sxpay_mchkey']}" class="layui-input"/>
									{if $info['sxpay_mchkey']}<div style="position: absolute;left: 0;top: 0;right: 0;bottom: 0; background: #fff;padding: .35rem .7rem;border: 1px solid rgba(0, 0, 0, .15);border-radius: .15rem;color: #636c72;" onclick="$(this).hide()">已隐藏内容，点击查看或编辑</div>{/if}
								</div>
							</div>

							{if getcustom('sxpay_mendian_info')}
							<div class="layui-form-item">
								<label class="layui-form-label">天阙终端编号：</label>
								<div class="layui-input-inline">
									<input type="text" name="info[sxpay_deviceNo]" value="{$info['sxpay_deviceNo']}" class="layui-input"/>
								</div>
							</div>
							{/if}
						</div>
						<div  diandaSwitchMulti="info[wxpay_type]" data-val="0" {if $info['wxpay_type']!=0}style="display:none"{/if}>
							<div class="layui-form-item">
								<label class="layui-form-label">支付商户号：</label>
								<div class="layui-input-inline">
									<input type="text" name="info[wxpay_mchid]" value="{$info['wxpay_mchid']}" class="layui-input"/>
								</div>
							</div>
							<div class="layui-form-item">
								<label class="layui-form-label">支付密钥：</label>
								<div class="layui-input-inline" style="width:280px">
									<input type="text" name="info[wxpay_mchkey]" value="{$info['wxpay_mchkey']}" class="layui-input"/>
									{if $info['wxpay_mchkey']}<div style="position: absolute;left: 0;top: 0;right: 0;bottom: 0; background: #fff;padding: .35rem .7rem;border: 1px solid rgba(0, 0, 0, .15);border-radius: .15rem;color: #636c72;" onclick="$(this).hide()">已隐藏内容，点击查看或编辑</div>{/if}
								</div>
								<div class="layui-form-mid layui-word-aux">请在 <a href="https://pay.weixin.qq.com" target="_blank">微信支付商户平台</a> [账户中心]-[API安全]中设置[APIv2密钥]</div>
							</div>
							<div class="layui-form-item">
								<label class="layui-form-label">PEM证书：</label>
								<div class="layui-input-inline" style="width:450px">
									<input style="float:left;" readonly="readonly" class="layui-input" type="text" name="info[wxpay_apiclient_cert]" value="{$info['wxpay_apiclient_cert']}" id="wxpay_apiclient_cert"/>
								</div>
								<button style="float:left;" type="button" class="layui-btn layui-btn-primary uploadfile" upload-input="wxpay_apiclient_cert" upload-preview="certPreview">上传</button>
								<div id="certPreview" class="layui-form-mid" style="margin-left:20px;">{if $info['wxpay_apiclient_cert']}已上传{/if}</div>
								<div class="layui-form-mid layui-word-aux" style="margin-left:10px;">apiclient_cert.pem 请在 <a href="https://pay.weixin.qq.com" target="_blank">微信支付商户平台</a> [账户中心]-[API安全]中设置[API证书]，设置完成后上传</div>
							</div>
							<div class="layui-form-item">
								<label class="layui-form-label">证书密钥：</label>
								<div class="layui-input-inline" style="width:450px">
									<input style="float:left;" readonly="readonly" class="layui-input" type="text" name="info[wxpay_apiclient_key]" value="{$info['wxpay_apiclient_key']}" id="wxpay_apiclient_key"/>
								</div>
								<button style="float:left;" type="button" class="layui-btn layui-btn-primary uploadfile" upload-input="wxpay_apiclient_key" upload-preview="keyPreview">上传</button>
								<div id="keyPreview" class="layui-form-mid" style="margin-left:20px;">{if $info['wxpay_apiclient_key']}已上传{/if}</div>
								<div class="layui-form-mid layui-word-aux" style="margin-left:10px;">apiclient_key.pem 请在 <a href="https://pay.weixin.qq.com" target="_blank">微信支付商户平台</a> [账户中心]-[API安全]中设置[API证书]，设置完成后上传</div>
							</div>
							<div class="layui-form-item">
								<label class="layui-form-label">证书序列号：</label>
								<div class="layui-input-inline" style="width:360px">
									<input type="text" name="info[wxpay_serial_no]" value="{$info['wxpay_serial_no']}" class="layui-input"/>
									{if $info['wxpay_serial_no']}<div style="position: absolute;left: 0;top: 0;right: 0;bottom: 0; background: #fff;padding: .35rem .7rem;border: 1px solid rgba(0, 0, 0, .15);border-radius: .15rem;color: #636c72;" onclick="$(this).hide()">已隐藏内容，点击查看或编辑</div>{/if}
								</div>
								<div class="layui-form-mid">使用商家转账到零钱功能时填写此项，否则不需要填写</div>
								<div class="layui-form-mid layui-word-aux">请在 <a href="https://pay.weixin.qq.com" target="_blank">微信支付商户平台</a> [账户中心]-[API安全]-[管理证书]中查看</div>
							</div>
							<fieldset class="layui-elem-field">
							  <legend>商家转账配置(APIv3配置)</legend>
							  <div class="layui-field-box">
								  <div class="layui-form-item">
									  <label class="layui-form-label">V3支付密钥：</label>
									  <div class="layui-input-inline" style="width:280px">
										  <input type="text" name="info[wxpay_mchkey_v3]" value="{$info['wxpay_mchkey_v3']}" class="layui-input"/>
										  {if $info['wxpay_mchkey_v3']}<div style="position: absolute;left: 0;top: 0;right: 0;bottom: 0; background: #fff;padding: .35rem .7rem;border: 1px solid rgba(0, 0, 0, .15);border-radius: .15rem;color: #636c72;" onclick="$(this).hide()">已隐藏内容，点击查看或编辑</div>{/if}
									  </div>
									  <div class="layui-form-mid layui-word-aux">请在 <a href="https://pay.weixin.qq.com" target="_blank">微信支付商户平台</a> [账户中心]-[API安全]中设置[APIv3密钥]</div>
								  </div>
								  <div class="layui-form-item">
									  <label class="layui-form-label">签名验签方式：</label>
									  <div class="layui-input-inline" style="width: 300px;">
										  <input type="radio" name="info[sign_type]" title="平台证书" value="0" {if $info['sign_type']==0}checked{/if} lay-filter="diandaSwitchMulti" />
										  <input type="radio" name="info[sign_type]" title="微信支付公钥" value="1" {if $info['sign_type']==1}checked{/if} lay-filter="diandaSwitchMulti" />
									  </div>
									  <div class="layui-form-mid layui-word-aux layui-clear">
										  根据自己 [账户中心]-[API安全]-[验证微信支付身份]的设置选择，不要随意切换：
										  <a target="_blank" href="https://pay.weixin.qq.com/doc/v3/merchant/4012154180">微信官方说明</a></div>
								  </div>
								  <div class="sign_type_0" diandaSwitchMulti="info[sign_type]" data-val="0" {if $info && $info['sign_type']!=0}style="display:none"{/if}>
									  <div class="layui-form-item">
										  <label class="layui-form-label">平台证书序列号：</label>
										  <div class="layui-input-inline">
											  <input type="text" name="info[wxpay_plate_serialno]" value="{$info['wxpay_plate_serialno']}" class="layui-input"/>
										  </div>
										  <div class="layui-form-mid layui-word-aux" style="margin-left:10px;">
											  获取方式：[账户中心]-[API安全]-[平台证书]-[管理证书]
										  </div>
									  </div>
									  <div class="layui-form-item">
										  <label class="layui-form-label">平台证书：</label>
										  <div class="layui-input-inline" style="width:450px">
											  <input style="float:left;" readonly="readonly" class="layui-input" type="text" name="info[wxpay_wechatpay_pem]" value="{$info['wxpay_wechatpay_pem']}" id="wxpay_wechatpay_pem"/>
										  </div>
										  <button style="float:left;" type="button" class="layui-btn layui-btn-primary uploadfile" upload-input="wxpay_wechatpay_pem" upload-preview="wechatpayPreview">手动上传</button>
										  <button style="float:left;margin-left: 10px;" type="button" class="layui-btn layui-btn-primary" onclick="download_wechatkey()">自动下载</button>
										  <div id="wechatpayPreview" class="layui-form-mid" style="margin-left:20px;">{if $info['wxpay_wechatpay_pem']}已上传{/if}</div>
										  <div class="layui-form-mid layui-word-aux layui-clear">
											  wechatpay.pem 请在 <a href="https://pay.weixin.qq.com/doc/v3/merchant/4012068814" target="_blank">微信支付商户平台</a> [账户中心]-[API安全]-[验证微信支付身份]中下载证书，设置完成后上传
											  <br/>注：使用自动下载需开启php的shell_exec函数
										  </div>
									  </div>
								  </div>
								  <div class="sign_type_1" diandaSwitchMulti="info[sign_type]" data-val="1" {if !$info || $info['sign_type']!=1}style="display:none"{/if}>
									  <div class="layui-form-item">
										  <label class="layui-form-label">公钥ID：</label>
										  <div class="layui-input-inline">
											  <input type="text" name="info[public_key_id]" value="{$info['public_key_id']}" class="layui-input"/>
										  </div>
										  <div class="layui-form-mid layui-word-aux" style="margin-left:10px;">
											  <a target="_blank" href="https://pay.weixin.qq.com/doc/v3/merchant/4013038816#Q:-%E5%A6%82%E4%BD%95%E8%8E%B7%E5%8F%96%E5%BE%AE%E4%BF%A1%E6%94%AF%E4%BB%98%E5%85%AC%E9%92%A5ID?">获取方式</a>
										  </div>
									  </div>
									  <div class="layui-form-item">
										  <label class="layui-form-label">公钥文件：</label>
										  <div class="layui-input-inline" style="width:450px">
											  <input style="float:left;" readonly="readonly" class="layui-input" type="text" name="info[public_key_pem]" value="{$info['public_key_pem']}" id="public_key_pem"/>
										  </div>
										  <button style="float:left;" type="button" class="layui-btn layui-btn-primary uploadfile" upload-input="public_key_pem" upload-preview="publickeyPreview">上传</button>
										  <div id="publickeyPreview" class="layui-form-mid" style="margin-left:20px;">{if $info['public_key_pem']}已上传{/if}</div>
										  <div class="layui-form-mid layui-word-aux" style="margin-left:10px;">pub_key.pem 请在 <a href="https://pay.weixin.qq.com" target="_blank">微信支付商户平台</a> [账户中心]-[API安全]中设置[微信支付公钥]，设置完成后上传</div>
									  </div>
								  </div>
								  <div class="layui-form-item">
									  <label class="layui-form-label">商家转账场景ID：</label>
									  <div class="layui-input-inline">
										  <input type="text" name="info[transfer_scene_id]" value="{$info['transfer_scene_id']|default='1005'}" readonly class="layui-input"/>
									  </div>
									  <div class="layui-form-mid layui-word-aux" style="margin-left:10px;">该笔转账使用的转账场景，可前往“商户平台-产品中心-<a target="_blank" href="https://pay.weixin.qq.com/xdc/mchtranstemplate/index.php/xphp/cgi/page/mch_trans/setting">商家转账</a>”中申请。目前仅支持【1005-佣金报酬】 </div>
								  </div>
								  <div class="layui-form-item">
									  <label class="layui-form-label">岗位类型：</label>
									  <div class="layui-input-inline">
										  <input type="text" name="info[transfer_scene_type]" value="{$info['transfer_scene_type']}" class="layui-input"/>
									  </div>
									  <div class="layui-form-mid layui-word-aux" style="margin-left:10px;">
										  请在信息内容描述收款用户的岗位类型，如外卖员、专家顾问，不填写默认【员工】
										  <a target="_blank" href="https://pay.weixin.qq.com/doc/v3/merchant/4012711988">详情介绍</a>
									  </div>
								  </div>
								  <div class="layui-form-item">
									  <label class="layui-form-label">报酬说明：</label>
									  <div class="layui-input-inline">
										  <input type="text" name="info[transfer_scene_content]" value="{$info['transfer_scene_content']}" class="layui-input"/>
									  </div>
									  <div class="layui-form-mid layui-word-aux" style="margin-left:10px;">
										  请在信息内容描述用户接收当前这笔报酬的原因，如7月份配送费，高温补贴，不填写默认审核备注
										  <a target="_blank" href="https://pay.weixin.qq.com/doc/v3/merchant/4012711988">详情介绍</a>
									  </div>
								  </div>
							  </div>
							</fieldset>
							{if getcustom('mobile_business_jinjian')}
						    <fieldset class="layui-elem-field">
							    <legend>服务商配置</legend>
							    <div class="layui-form-item">
								    <label class="layui-form-label">小程序APPID：</label>
								    <div class="layui-input-inline">
									    <input type="text" name="info[fws_wxpay_appid]" value="{$info['fws_wxpay_appid']}" class="layui-input"/>
								    </div>
							    </div>
							    <div class="layui-form-item">
								    <label class="layui-form-label">支付商户号：</label>
								    <div class="layui-input-inline">
									    <input type="text" name="info[fws_wxpay_mchid]" value="{$info['fws_wxpay_mchid']}" class="layui-input"/>
								    </div>
							    </div>
							    <div class="layui-form-item">
								    <label class="layui-form-label">支付密钥：</label>
								    <div class="layui-input-inline" style="width:280px">
									    <input type="text" name="info[fws_wxpay_mchkey]" value="{$info['fws_wxpay_mchkey']}" class="layui-input"/>
									    {if $info['fws_wxpay_mchkey']}<div style="position: absolute;left: 0;top: 0;right: 0;bottom: 0; background: #fff;padding: .35rem .7rem;border: 1px solid rgba(0, 0, 0, .15);border-radius: .15rem;color: #636c72;" onclick="$(this).hide()">已隐藏内容，点击查看或编辑</div>{/if}
								    </div>
								    <div class="layui-form-mid layui-word-aux">请在 <a href="https://pay.weixin.qq.com" target="_blank">微信支付商户平台</a> [账户中心]-[API安全]中设置[APIv2密钥]</div>
							    </div>
							    <div class="layui-form-item">
								    <label class="layui-form-label">PEM证书：</label>
								    <div class="layui-input-inline" style="width:450px">
									    <input style="float:left;" readonly="readonly" class="layui-input" type="text" name="info[fws_wxpay_apiclient_cert]" value="{$info['fws_wxpay_apiclient_cert']}" id="fws_wxpay_apiclient_cert"/>
								    </div>
								    <button style="float:left;" type="button" class="layui-btn layui-btn-primary uploadfile" upload-input="fws_wxpay_apiclient_cert" upload-preview="fws_certPreview">上传</button>
								    <div id="fws_certPreview" class="layui-form-mid" style="margin-left:20px;">{if $info['fws_wxpay_apiclient_cert']}已上传{/if}</div>
								    <div class="layui-form-mid layui-word-aux" style="margin-left:10px;">apiclient_cert.pem 请在 <a href="https://pay.weixin.qq.com" target="_blank">微信支付商户平台</a> [账户中心]-[API安全]中设置[API证书]，设置完成后上传</div>
							    </div>
							    <div class="layui-form-item">
								    <label class="layui-form-label">证书密钥：</label>
								    <div class="layui-input-inline" style="width:450px">
									    <input style="float:left;" readonly="readonly" class="layui-input" type="text" name="info[fws_wxpay_apiclient_key]" value="{$info['fws_wxpay_apiclient_key']}" id="fws_wxpay_apiclient_key"/>
								    </div>
								    <button style="float:left;" type="button" class="layui-btn layui-btn-primary uploadfile" upload-input="fws_wxpay_apiclient_key" upload-preview="fws_keyPreview">上传</button>
								    <div id="fws_keyPreview" class="layui-form-mid" style="margin-left:20px;">{if $info['fws_wxpay_apiclient_key']}已上传{/if}</div>
								    <div class="layui-form-mid layui-word-aux" style="margin-left:10px;">apiclient_key.pem 请在 <a href="https://pay.weixin.qq.com" target="_blank">微信支付商户平台</a> [账户中心]-[API安全]中设置[API证书]，设置完成后上传</div>
							    </div>
							    <div class="layui-form-item">
								    <label class="layui-form-label">证书序列号：</label>
								    <div class="layui-input-inline" style="width:360px">
									    <input type="text" name="info[fws_wxpay_serial_no]" value="{$info['fws_wxpay_serial_no']}" class="layui-input"/>
									    {if $info['fws_wxpay_serial_no']}<div style="position: absolute;left: 0;top: 0;right: 0;bottom: 0; background: #fff;padding: .35rem .7rem;border: 1px solid rgba(0, 0, 0, .15);border-radius: .15rem;color: #636c72;" onclick="$(this).hide()">已隐藏内容，点击查看或编辑</div>{/if}
								    </div>
								    <div class="layui-form-mid">使用商家转账到零钱功能时填写此项，否则不需要填写</div>
								    <div class="layui-form-mid layui-word-aux">请在 <a href="https://pay.weixin.qq.com" target="_blank">微信支付商户平台</a> [账户中心]-[API安全]-[管理证书]中查看</div>
							    </div>
							    <div class="layui-form-item">
								    <label class="layui-form-label">APIv3密钥：</label>
								    <div class="layui-input-inline" style="width:360px">
									    <input type="text" name="info[fws_wxpay_mch_api_key]" value="{$info['fws_wxpay_mch_api_key']}" class="layui-input"/>
									    {if $info['fws_wxpay_mch_api_key']}<div style="position: absolute;left: 0;top: 0;right: 0;bottom: 0; background: #fff;padding: .35rem .7rem;border: 1px solid rgba(0, 0, 0, .15);border-radius: .15rem;color: #636c72;" onclick="$(this).hide()">已隐藏内容，点击查看或编辑</div>{/if}
								    </div>
								    <div class="layui-form-mid layui-word-aux">请在 <a href="https://pay.weixin.qq.com" target="_blank">微信支付商户平台</a> [账户中心]-[API安全]-[解密回调]中查看</div>
							    </div>
						    </fieldset>
	                        {/if}
						</div>
						{if getcustom('pay_huifu')}
						<div diandaSwitchMulti="info[wxpay_type]" data-val="4" {if $info['wxpay_type'] !=4}style="display:none"{/if}>
						<div class="layui-form-item">
							<label class="layui-form-label">系统号sys_id：</label>
							<div class="layui-input-inline">
								<input type="text" name="info[huifu_sys_id]" value="{$info['huifu_sys_id']}" class="layui-input"/>
							</div>
							<div class="layui-form-mid layui-word-aux">渠道商/商户的huifu_id，请在<a href="https://dashboard.huifu.com/customers/login" target="_blank">商户后台</a>[开发设置]-[开发者信息]查找</div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label">产品号product_id：</label>
							<div class="layui-input-inline">
								<input type="text" name="info[huifu_product_id]" value="{$info['huifu_product_id']}" class="layui-input"/>
							</div>
							<div class="layui-form-mid layui-word-aux">请在<a href="https://dashboard.huifu.com/customers/login" target="_blank">商户后台</a>[开发设置]-[开发者信息]查找</div>
						</div>

						<div class="layui-form-item">
							<label class="layui-form-label">商户公钥：</label>
							<div class="layui-input-inline" style="width:500px">
								<input type="text" name="info[huifu_merch_public_key]" value="{$info['huifu_merch_public_key']}" class="layui-input"/>
								{if $info['huifu_merch_public_key']}<div style="position: absolute;left: 0;top: 0;right: 0;bottom: 0; background: #fff;padding: .35rem .7rem;border: 1px solid rgba(0, 0, 0, .15);border-radius: .15rem;color: #636c72;" onclick="$(this).hide()">已隐藏内容，点击查看或编辑</div>{/if}
							</div>
							<div class="layui-form-mid layui-word-aux">请在<a href="https://dashboard.huifu.com/customers/login" target="_blank">商户后台</a>[开发设置]-[密钥管理]查找</div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label">商户私钥：</label>
							<div class="layui-input-inline" style="width:500px">
								<input type="text" name="info[huifu_merch_private_key]" value="{$info['huifu_merch_private_key']}" class="layui-input"/>
								{if $info['huifu_merch_private_key']}<div style="position: absolute;left: 0;top: 0;right: 0;bottom: 0; background: #fff;padding: .35rem .7rem;border: 1px solid rgba(0, 0, 0, .15);border-radius: .15rem;color: #636c72;" onclick="$(this).hide()">已隐藏内容，点击查看或编辑</div>{/if}
							</div>
							<div class="layui-form-mid layui-word-aux">请在<a href="https://dashboard.huifu.com/customers/login" target="_blank">商户后台</a>[开发设置]-[密钥管理]查找</div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label">汇付公钥：</label>
							<div class="layui-input-inline" style="width:500px">
								<input type="text" name="info[huifu_public_key]" value="{$info['huifu_public_key']}" class="layui-input"/>
								{if $info['huifu_public_key']}<div style="position: absolute;left: 0;top: 0;right: 0;bottom: 0; background: #fff;padding: .35rem .7rem;border: 1px solid rgba(0, 0, 0, .15);border-radius: .15rem;color: #636c72;" onclick="$(this).hide()">已隐藏内容，点击查看或编辑</div>{/if}
							</div>
							<div class="layui-form-mid layui-word-aux">请在<a href="https://dashboard.huifu.com/customers/login" target="_blank">商户后台</a>[开发设置]-[密钥管理]查找</div>
						</div>
					</div>
					  {/if}
					  {if getcustom('pay_allinpay')}
						<div diandaSwitchMulti="info[wxpay_type]" data-val="6" {if $info['wxpay_type'] !=6}style="display:none"{/if}>
							<div class="layui-form-item">
								<label class="layui-form-label">通联支付：</label>
								<div class="layui-input-inline">
									<div class="layui-form-mid layui-word-aux"> <a href="javascript:void(0)" onclick="openmax('{:url('AllinpayYunstSet/index')}&isopen=1')">点击查看设置</a></div>
								</div>
							</div>
						</div>
					  {/if}
					  {if getcustom('pay_qilinshuzi')}
                      <div diandaSwitchMulti="info[wxpay_type]" data-val="10" {if $info['wxpay_type'] !=10}style="display:none"{/if}>
						  <div class="layui-form-item">
							  <label class="layui-form-label">应用ID：</label>
							  <div class="layui-input-inline" style="width:300px">
								  <input type="text" name="info[qilin_appid]" value="{$info['qilin_appid']}" class="layui-input"/>
							  </div>
							  <div class="layui-form-mid layui-word-aux">请在<a href="https://b.qilinshuzi.com/login?redirect=/apps" target="_blank">麒麟数字后台</a>[产品中心]-[应用管理]-[更多]-[开发配置]</div>
						  </div>
						  <div class="layui-form-item">
							  <label class="layui-form-label">MD5密钥：</label>
							  <div class="layui-input-inline" style="width:300px">
								  <input type="text" name="info[qilin_secret]" value="{$info['qilin_secret']}" class="layui-input"/>
								  {if $info['qilin_secret']}
								  <div style="position: absolute;left: 0;top: 0;right: 0;bottom: 0; background: #fff;padding: .35rem .7rem;border: 1px solid rgba(0, 0, 0, .15);border-radius: .15rem;color: #636c72;" onclick="$(this).hide()">已隐藏内容，点击查看或编辑 </div>
								  {/if}
							  </div>
							  <div class="layui-form-mid layui-word-aux">请在<a href="https://dashboard.huifu.com/customers/login" target="_blank">麒麟数字后台</a>[开发设置]-[开发者信息]查找</div>
						  </div>
						  <div class="layui-form-item">
							  <label class="layui-form-label">商户号：</label>
							  <div class="layui-input-inline" style="width:300px">
								  <input type="text" name="info[qilin_mch_id]" value="{$info['qilin_mch_id']}" class="layui-input"/>
							  </div>
							  <div class="layui-form-mid layui-word-aux">请在<a href="https://b.qilinshuzi.com/login?redirect=/apps" target="_blank">麒麟数字后台</a>[商家中心]-[商户管理]</div>
						  </div>
						  <div class="layui-form-item">
							  <label class="layui-form-label">门店编号：</label>
							  <div class="layui-input-inline" style="width:300px">
								  <input type="text" name="info[qilin_store_id]" value="{$info['qilin_store_id']}" class="layui-input"/>
							  </div>
							  <div class="layui-form-mid layui-word-aux">请在<a href="https://b.qilinshuzi.com/login?redirect=/apps" target="_blank">麒麟数字后台</a>[商家中心]-[门店管理]</div>
						  </div>
					  </div>
					  {/if}
						{if getcustom('pay_huifu') && getcustom('pay_huifu_quickpay') && ($auth_data=='all' || in_array('HuifuQuickPay',$auth_data))}
				  <fieldset class="layui-elem-field">
					  <legend>汇付斗拱快捷支付</legend>
						<div class="layui-form-item">
						  <label class="layui-form-label">快捷支付：</label>
						  <div class="layui-input-inline">
							  <input type="radio" name="info[huifu_quickpay_st]" title="开启" value="1" {if $info['huifu_quickpay_st']==1}checked{/if} lay-filter="huifu_quickpay_st"/>
							  <input type="radio" name="info[huifu_quickpay_st]" title="关闭" value="0" {if $info['huifu_quickpay_st']==0}checked{/if} lay-filter="huifu_quickpay_st"/>
						  </div>
						  <div class="layui-form-mid layui-word-aux">开启后，公众号可以使用汇付斗拱快捷支付进行支付，详见<a href="https://paas.huifu.com/open/doc/guide/#/zffssm/guide_zffssm_kj?id=h5" target="_blank">《汇付斗拱-H5端快捷支付》</a></div>
						</div>
						<!--上面切换未找到，加和上面汇付天下斗拱同样内容-->
						  <div  id="huifu_set" {if $info['huifu_quickpay_st'] ==0}style="display:none"{/if}>
							  <div class="layui-form-item">
								  <label class="layui-form-label">系统号sys_id：</label>
								  <div class="layui-input-inline">
									  <input type="text" name="info[huifu_sys_id2]" value="{$info['huifu_sys_id']}" class="layui-input"/>
								  </div>
								  <div class="layui-form-mid layui-word-aux">渠道商/商户的huifu_id，请在<a href="https://dashboard.huifu.com/customers/login" target="_blank">商户后台</a>[开发设置]-[开发者信息]查找</div>
							  </div>
							  <div class="layui-form-item">
								  <label class="layui-form-label">产品号product_id：</label>
								  <div class="layui-input-inline">
									  <input type="text" name="info[huifu_product_id2]" value="{$info['huifu_product_id']}" class="layui-input"/>
								  </div>
								  <div class="layui-form-mid layui-word-aux">请在<a href="https://dashboard.huifu.com/customers/login" target="_blank">商户后台</a>[开发设置]-[开发者信息]查找</div>
							  </div>
							
							  <div class="layui-form-item">
								  <label class="layui-form-label">商户公钥：</label>
								  <div class="layui-input-inline" style="width:500px">
									  <input type="text" name="info[huifu_merch_public_key2]" value="{$info['huifu_merch_public_key']}" class="layui-input"/>
									  {if $info['huifu_merch_public_key']}<div style="position: absolute;left: 0;top: 0;right: 0;bottom: 0; background: #fff;padding: .35rem .7rem;border: 1px solid rgba(0, 0, 0, .15);border-radius: .15rem;color: #636c72;" onclick="$(this).hide()">已隐藏内容，点击查看或编辑</div>{/if}
								  </div>
								  <div class="layui-form-mid layui-word-aux">请在<a href="https://dashboard.huifu.com/customers/login" target="_blank">商户后台</a>[开发设置]-[密钥管理]查找</div>
							  </div>
							  <div class="layui-form-item">
								  <label class="layui-form-label">商户私钥：</label>
								  <div class="layui-input-inline" style="width:500px">
									  <input type="text" name="info[huifu_merch_private_key2]" value="{$info['huifu_merch_private_key']}" class="layui-input"/>
									  {if $info['huifu_merch_private_key']}<div style="position: absolute;left: 0;top: 0;right: 0;bottom: 0; background: #fff;padding: .35rem .7rem;border: 1px solid rgba(0, 0, 0, .15);border-radius: .15rem;color: #636c72;" onclick="$(this).hide()">已隐藏内容，点击查看或编辑</div>{/if}
								  </div>
								  <div class="layui-form-mid layui-word-aux">请在<a href="https://dashboard.huifu.com/customers/login" target="_blank">商户后台</a>[开发设置]-[密钥管理]查找</div>
							  </div>
							  <div class="layui-form-item">
								  <label class="layui-form-label">汇付公钥：</label>
								  <div class="layui-input-inline" style="width:500px">
									  <input type="text" name="info[huifu_public_key2]" value="{$info['huifu_public_key']}" class="layui-input"/>
									  {if $info['huifu_public_key']}<div style="position: absolute;left: 0;top: 0;right: 0;bottom: 0; background: #fff;padding: .35rem .7rem;border: 1px solid rgba(0, 0, 0, .15);border-radius: .15rem;color: #636c72;" onclick="$(this).hide()">已隐藏内容，点击查看或编辑</div>{/if}
								  </div>
								  <div class="layui-form-mid layui-word-aux">请在<a href="https://dashboard.huifu.com/customers/login" target="_blank">商户后台</a>[开发设置]-[密钥管理]查找</div>
							  </div>
						  </div>
				  </fieldset>
						{/if}
						<div class="layui-form-item">
							<label class="layui-form-label"></label>
							<div class="layui-input-block">
								<button class="layui-btn" lay-submit lay-filter="formsubmit">提 交</button>
							</div>
						</div>
					</div>
				</div>
      </div>
    </div>
  </div>
	{include file="public/js"/}
	<script>
	layui.form.on('radio(wxpay_type)', function(data){
		$('#wxpay_type0set').hide();
		$('#wxpay_type1set').hide();
		$('#wxpay_type3set').hide();
		if(data.value == '0'){
			$('#wxpay_type0set').show();
		}else if(data.value == '1'){
			$('#wxpay_type1set').show();
		}else if(data.value == '3'){
			$('#wxpay_type3set').show();
		}
	})
	layui.form.on('submit(formsubmit)', function(obj){
		var field = obj.field
		$.post('',field,function(data){
			dialog(data.msg,data.status,data.url);
		})
	})
	//下载微信支付平台证书
	function download_wechatkey(){
		var wxpay_mchid = $('input[name="info[wxpay_mchid]"]').val();
		if(!wxpay_mchid){
			return layer.msg('请填写【支付商户号】');
		}
		var wxpay_apiclient_key = $('input[name="info[wxpay_apiclient_key]"]').val();
		if(!wxpay_apiclient_key){
			return layer.msg('请上传【证书密钥】');
		}
		var wxpay_serial_no = $('input[name="info[wxpay_serial_no]"]').val();
		if(!wxpay_serial_no){
			return layer.msg('请填写【证书序列号】');
		}
		var wxpay_mchkey_v3 = $('input[name="info[wxpay_mchkey_v3]"]').val();
		if(!wxpay_mchkey_v3){
			return layer.msg('请填写【V3支付密钥】');
		}
		var wxpay_plate_serialno = $('input[name="info[wxpay_plate_serialno]"]').val();
		$.post('{:url("Mppay/download_wechatkey")}',{
			wxpay_mchkey_v3:wxpay_mchkey_v3,
			wxpay_mchid:wxpay_mchid,
			wxpay_apiclient_key:wxpay_apiclient_key,
			wxpay_serial_no:wxpay_serial_no,
			wxpay_plate_serialno:wxpay_plate_serialno
		},function(data){
			console.log(data);
			if(data.status==1){
				$('input[name="info[wxpay_wechatpay_pem]"]').val(data.data);
			}
			dialog(data.msg,data.status);
		})
	}
	{if getcustom('pay_huifu_quickpay')}
	layui.form.on('radio(huifu_quickpay_st)', function(data){
		if(data.value == '0'){
			$('#huifu_set').hide();
		}else if(data.value == '1'){
			$('#huifu_set').show();
		}
	})
	{/if}
  </script>
	{include file="public/copyright"/}
</body>
</html>